//----------------------顶层引用-----------------------
//----------------------必须在第一行-----------------------
//import '@babel/polyfill';
import 'core-js';
import Vue from 'vue';
import Vuex from 'vuex';
import App from './App.vue';
import router from './router';
import './index.less';
import {
  Switch,
  Circle
} from 'view-design';
Vue.config.productionTip = false;
Vue.use(Vuex);
Vue.component('i-switch', Switch);
Vue.component('i-circle', Circle);
const store = new Vuex.Store({
  /** 是否启用严格模式，启动该模式则只能通过mutations去改变model的state，
   * 如果需要在运行时需要在state种新增属性，则请不要开启此模式 */
  strict: false
});
window.store = store;

// eslint-disable-next-line
String.prototype.startWith = function (prefix) {
  return this.slice(0, prefix.length) === prefix;
};

// eslint-disable-next-line
String.prototype.endWith = function (prefix) {
  if (!prefix || prefix === '' || prefix.length > this.length) {
    return false;
  } else {
    const thisPrefix = this.substring(this.length - prefix.length);
    return thisPrefix === prefix;
  }
};

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#root');